﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;
using ZFB.DTO;

namespace ZFB.IServices
{
    public interface IUserServices
    {
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        Task<ApiResult> AddNewAsync(string phoneNum, string password);
        /// <summary>
        /// 根据id获取用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> GetById(long id);
        /// <summary>
        /// 根据手机号获取
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <returns></returns>
        Task<ApiResult> GetByPhoneNumAsync(string phoneNum);
        /// <summary>
        /// 检查用户名密码是否正确(很好体现了分层的思想)
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        Task<ApiResult> CheckLoginAsync(string phoneNum, string password);
        /// <summary>
        /// 更新密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="newPassword"></param>
        Task<ApiResult> UpdatePwdAsync(string phoneNum, string newPassword);
        /// <summary>
        /// 设置用户userId 的城市id
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="cityId"></param>
        Task<ApiResult> SetUserCityIdAsync(long userId, long cityId);
    }
}
